<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>表格单元格合并</title>
</head>

<body>
    <!-- 
    水平合并：colspan 保留左边删除右边
    垂直合并：rowspan 保留上边删除下边
    -->
    <table border="1" width="500px" height="500px" style="text-align: center;">
        <tr>
            <td colspan="4">1</td>
        </tr>
        <tr>
            <td rowspan="2">2</td>
            <td>2</td>
            <td>2</td>
            <td>2</td>
        </tr>
        <tr>
            <td>3</td>
            <td>3</td>
            <td>3</td>
        </tr>
        <tr>
            <td colspan="2" rowspan="2">4</td>
            <td>4</td>
            <td>4</td>
        </tr>
        <tr>
            <td>5</td>
            <td>5</td>
        </tr>
    </table>
</body>

</html>